package com.jxmcloud.business.cut.mapper.database;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jxmcloud.business.cut.model.database.DBUserInviteSuccess;
import com.jxmcloud.business.cut.model.query.InviteSuccessQuery;
import com.jxmcloud.business.cut.vo.InviteSuccessVo;
import com.jxmcloud.business.cut.vo.client.InviteSuccessCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface IInviteSuccessDBMapper extends BaseMapper<DBUserInviteSuccess> {
    // 使用JPQL分组统计
    InviteSuccessCountVo inviteSuccessCount(@Param("activityId") Integer activityId, @Param("userId") Integer userId);

    /**
     * 统计邀请用户数量
     * @param activityId 活动ID
     * @param userId 用户ID
     * @return 邀请用户数量
     */
    List<InviteSuccessCountVo> inviteCount(@Param("activityId") Integer activityId, @Param("userId") Integer userId);

    /**
     * 分页查询邀请成功用户列表
     * @param query 查询条件
     * @return 分页结果
     */
    IPage<InviteSuccessVo> selectInviteSuccessPage(@Param("query") InviteSuccessQuery query);
}
